package com.wan.server.util;

import com.wan.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

/**
 * Description: 操作员工具类
 * date: 2021/12/24 10:10
 *
 * @author 万富
 * @since JDK 1.8
 */
public class AdminUtils {

    /**
     * 获取当前登录员
     * @return
     */
    public static Admin getCurrentAdmin(){
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
